﻿Imports extremo

Public Class NuevoUsuario
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Try
            Dim negocio = New UsuarioNegocio
            negocio.insertar(Me.txtNombre.Text, Me.txtApepaterno.Text, Me.txtApematerno.Text, Me.txtEdad.Text, Me.txtUsuario.Text, Me.txtContraseña.Text, Me.txtDireccion.Text, Me.txtDistrito.Text, Me.txtTelefono.Text, Me.txtEmail.Text, Me.txtSexo.Text)

            Me.txtNombre.Text = ""
            Me.txtApepaterno.Text = ""
            Me.txtApematerno.Text = ""
            Me.txtEdad.Text = ""
            Me.txtUsuario.Text = ""
            Me.txtContraseña.Text = ""
            Me.txtDireccion.Text = ""
            Me.txtDistrito.Text = ""
            Me.txtTelefono.Text = ""
            Me.txtEmail.Text = ""
            Me.txtSexo.Text = ""
            Response.Write("Se insertó correctamente")

        Catch ex As Exception
            Response.Write("Problemas al insertar")
        End Try
    End Sub

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
        Response.Redirect("Usuarios.aspx", True)
    End Sub


End Class